package com.philip.journal.home.bean;

// Generated Aug 25, 2010 5:50:05 PM by Hibernate Tools 3.2.2.GA

import com.philip.journal.core.bean.AbstractAuditableBean;

/**
 * Represents a Configuration Item in the Journal Application preferences.
 */
public class ConfigItem extends AbstractAuditableBean {

    /** Primary key attribute. */
    private long configId;

    /** Config item name. */
    private String name;

    /** This attribute is used for filtering. */
    private String tags;

    /** Default value reference in case a revert is needed. */
    private String defaultValue;

    /** Reference to parent config item. */
    private ConfigItem parent;

    /** Default constructor. */
    public ConfigItem() {
        super();
    }

    /**
     * Default parameterized constructor.
     *
     * @param pName initial Config item name.
     * @param pTags initial tags
     * @param pDefaultValue initial default value.
     */
    public ConfigItem(final String pName, final String pTags, final String pDefaultValue) {
        this();
        this.name = pName;
        this.tags = pTags;
        this.defaultValue = pDefaultValue;
    }

    public long getConfigId() {
        return this.configId;
    }

    public void setConfigId(final long pConfigId) {
        this.configId = pConfigId;
    }
    public String getName() {
        return this.name;
    }

    public void setName(final String pName) {
        this.name = pName;
    }
    public String getTags() {
        return this.tags;
    }

    public void setTags(final String pTags) {
        this.tags = pTags;
    }
    public String getDefaultValue() {
        return this.defaultValue;
    }

    public void setDefaultValue(final String pDefaultValue) {
        this.defaultValue = pDefaultValue;
    }
    public ConfigItem getParent() {
        return this.parent;
    }

    /** @param pParent new parent to set. */
    public void setParent(final ConfigItem pParent) {
        this.parent = pParent;
    }

    /**
     * (COPIED from interface). <br/>
     * Sub class should identify which field stands as primary.
     *
     * @return the primary key field attribute name.
     * @see com.philip.journal.core.bean.AbstractAuditableBean#getPrimaryKeyField()
     */
    @Override
    public String getPrimaryKeyField() {
        return "configId";
    }

}
